import pytest

from page.login_page import LoginPage

project_name = 'Demo'
identifier = 'demo'
# 过期时间
past_time1 = "2020-02-25"
past_time2 = "2021-07-04"


@pytest.fixture(scope="class")
def log_on():
    login = LoginPage().get_cookie()
    yield login


@pytest.fixture(scope="class")
def ware_man(log_on):
    ware = log_on.click().goto_ware_man()
    yield ware
    # log_on.quit()


@pytest.fixture(scope="class")
def goods(log_on):
    goods = log_on.click().goto_goods_list()
    yield goods
    # log_on.quit()


@pytest.fixture(scope="function")
def order_entry(log_on):
    entry = log_on.click().goto_order_entry()
    yield entry
    # log_on.quit()
    # entry.goto_order_form_page().cancel_order().to_cancel_order_list().search_num().delete_order()


@pytest.fixture(scope="class")
def channel_temp(log_on):
    temp = log_on.click().goto_channel_template()
    yield temp
    # log_on.quit()


@pytest.fixture(scope="class")
def freight_temp(log_on):
    temp = log_on.click().goto_freight_template()
    yield temp
    temp.quit()


@pytest.fixture(scope="class")
def delivery_temp(log_on):
    temp = log_on.click().goto_delivery_template()
    yield temp
    log_on.quit()


@pytest.fixture()
def order_list(log_on):
    l = log_on.click().goto_order_form_page()
    yield l
    # log_on.quit()
